package com.ss.android.article.base.feature.update.activity;

import android.view.View;

import com.bytedance.common.utility.UIUtils;
import com.ss.android.article.base.feature.update.a.b;
import com.ss.android.article.base.feature.update.a.c;
import com.ss.android.common.util.NetworkUtils;

final class s implements View.OnClickListener {
    private final com.ss.android.article.base.feature.update.activity.g.g$d c;
    private final c a;
    private final com.ss.android.article.base.feature.update.activity.g.c b;

    s(com.ss.android.article.base.feature.update.activity.g.g$d arg1, c arg2, com.ss.android.article.base.feature.update.activity.g.c arg3) {
        this.c = arg1;
        this.a = arg2;
        this.b = arg3;

    }

    public final void onClick(View arg7) {
        int v0 = 0;
        if (this.a != null && this.a.d != null) {
            com.ss.android.article.base.feature.update.activity.g.g$d v2 = this.c;
            c v3 = this.a;
            if (v3 != null) {
                if (v3.h) {
                    v2.e.b(com.ss.android.article.browser.R.string.ss_hint_digg);
                } else if (NetworkUtils.isNetworkAvailable(v2.f)) {
                    b v0_1 = new b(4);
                    v0_1.j = v3.a;
                    new com.ss.android.article.base.feature.update.b.b(v2.f, v0_1).start();
                    v0 = 1;
                }
            }

            if (v0 == 0) {
                return;
            }

            if (this.b == null) {
                return;
            }

            if (this.b.n == null) {
                return;
            }

            if (this.c.e.n == null) {
                return;
            }

            this.c.e.a("replier_digg_click");
            this.b.n.onDiggClick();
            ++this.a.g;
            this.a.h = true;
            this.b.n.setSelected(true);
            this.b.n.setText(UIUtils.a(this.a.g));
        }
    }
}

